<?php

/**
 * sfGuardUserProfile filter form base class.
 *
 * @package    BuLaBuSys2013
 * @subpackage filter
 * @author     Maximilian Lenkeit
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasesfGuardUserProfileFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'participant_id'        => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Participant'), 'add_empty' => true)),
      'user_id'               => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('User'), 'add_empty' => true)),
      'first_name'            => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'last_name'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'email_address'         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'chapter'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'state_association'     => new sfWidgetFormChoice(array('choices' => array('' => '', 'by' => 'by', 'bw' => 'bw', 'be' => 'be', 'bb' => 'bb', 'br' => 'br', 'ha' => 'ha', 'he' => 'he', 'mp' => 'mp', 'ni' => 'ni', 'nr' => 'nr', 'rp' => 'rp', 'sr' => 'sr', 'sx' => 'sx', 'sa' => 'sa', 'sh' => 'sh', 'th' => 'th'))),
      'is_participant'        => new sfWidgetFormChoice(array('choices' => array('' => 'yes or no', 1 => 'yes', 0 => 'no'))),
      'invoice_street'        => new sfWidgetFormFilterInput(),
      'invoice_zip_code'      => new sfWidgetFormFilterInput(),
      'invoice_city'          => new sfWidgetFormFilterInput(),
      'contact_phone_number'  => new sfWidgetFormFilterInput(),
      'contact_mobile_number' => new sfWidgetFormFilterInput(),
      'created_at'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
      'updated_at'            => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => false)),
    ));

    $this->setValidators(array(
      'participant_id'        => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('Participant'), 'column' => 'id')),
      'user_id'               => new sfValidatorDoctrineChoice(array('required' => false, 'model' => $this->getRelatedModelName('User'), 'column' => 'id')),
      'first_name'            => new sfValidatorPass(array('required' => false)),
      'last_name'             => new sfValidatorPass(array('required' => false)),
      'email_address'         => new sfValidatorPass(array('required' => false)),
      'chapter'               => new sfValidatorPass(array('required' => false)),
      'state_association'     => new sfValidatorChoice(array('required' => false, 'choices' => array('by' => 'by', 'bw' => 'bw', 'be' => 'be', 'bb' => 'bb', 'br' => 'br', 'ha' => 'ha', 'he' => 'he', 'mp' => 'mp', 'ni' => 'ni', 'nr' => 'nr', 'rp' => 'rp', 'sr' => 'sr', 'sx' => 'sx', 'sa' => 'sa', 'sh' => 'sh', 'th' => 'th'))),
      'is_participant'        => new sfValidatorChoice(array('required' => false, 'choices' => array('', 1, 0))),
      'invoice_street'        => new sfValidatorPass(array('required' => false)),
      'invoice_zip_code'      => new sfValidatorPass(array('required' => false)),
      'invoice_city'          => new sfValidatorPass(array('required' => false)),
      'contact_phone_number'  => new sfValidatorPass(array('required' => false)),
      'contact_mobile_number' => new sfValidatorPass(array('required' => false)),
      'created_at'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
      'updated_at'            => new sfValidatorDateRange(array('required' => false, 'from_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 00:00:00')), 'to_date' => new sfValidatorDateTime(array('required' => false, 'datetime_output' => 'Y-m-d 23:59:59')))),
    ));

    $this->widgetSchema->setNameFormat('sf_guard_user_profile_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'sfGuardUserProfile';
  }

  public function getFields()
  {
    return array(
      'id'                    => 'Number',
      'participant_id'        => 'ForeignKey',
      'user_id'               => 'ForeignKey',
      'first_name'            => 'Text',
      'last_name'             => 'Text',
      'email_address'         => 'Text',
      'chapter'               => 'Text',
      'state_association'     => 'Enum',
      'is_participant'        => 'Boolean',
      'invoice_street'        => 'Text',
      'invoice_zip_code'      => 'Text',
      'invoice_city'          => 'Text',
      'contact_phone_number'  => 'Text',
      'contact_mobile_number' => 'Text',
      'created_at'            => 'Date',
      'updated_at'            => 'Date',
    );
  }
}
